<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            // 身高
            $table->unsignedSmallInteger('height')->default(0)->comment('身高 cm')->after('password'); // 单位：厘米
            // 目标体重
            $table->decimal('target_weight', 5, 2)->default(0.00)->comment('目标体重')->after('password');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('height');
            $table->dropColumn('target_weight');
        });
    }
};
